using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace Daniel.Core.Models.Mapping
{
    public class CheckoutAttributeMap : EntityTypeConfiguration<CheckoutAttribute>
    {
        public CheckoutAttributeMap()
        {
            // Primary Key
            this.HasKey(t => t.Id);

            // Properties
            this.Property(t => t.Name)
                .IsRequired()
                .HasMaxLength(400);

            // Table & Column Mappings
            this.ToTable("CheckoutAttribute");
            this.Property(t => t.Id).HasColumnName("Id");
            this.Property(t => t.Name).HasColumnName("Name");
            this.Property(t => t.TextPrompt).HasColumnName("TextPrompt");
            this.Property(t => t.IsRequired).HasColumnName("IsRequired");
            this.Property(t => t.ShippableProductRequired).HasColumnName("ShippableProductRequired");
            this.Property(t => t.IsTaxExempt).HasColumnName("IsTaxExempt");
            this.Property(t => t.TaxCategoryId).HasColumnName("TaxCategoryId");
            this.Property(t => t.AttributeControlTypeId).HasColumnName("AttributeControlTypeId");
            this.Property(t => t.DisplayOrder).HasColumnName("DisplayOrder");
            this.Property(t => t.LimitedToStores).HasColumnName("LimitedToStores");
            this.Property(t => t.ValidationMinLength).HasColumnName("ValidationMinLength");
            this.Property(t => t.ValidationMaxLength).HasColumnName("ValidationMaxLength");
            this.Property(t => t.ValidationFileAllowedExtensions).HasColumnName("ValidationFileAllowedExtensions");
            this.Property(t => t.ValidationFileMaximumSize).HasColumnName("ValidationFileMaximumSize");
            this.Property(t => t.DefaultValue).HasColumnName("DefaultValue");
        }
    }
}
